import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace PackageApi {
  /** 婚礼套餐信息 */
  export interface Package {
    id: number; // 
    packageId?: string; // 套餐ID
    packageType?: string; // 套餐类型(BASIC/STANDARD/PREMIUM/LUXURY)
    packageName: string; // 套餐名称
    serviceItems: string; // 服务项列表(JSON)
    discountRate: number; // 折扣率
    description: string; // 套餐描述
    isActive: number; // 是否启用
  }
}

/** 查询婚礼套餐分页 */
export function getPackagePage(params: PageParam) {
  return requestClient.get<PageResult<PackageApi.Package>>('/wedding/package/page', { params });
}

/** 查询婚礼套餐详情 */
export function getPackage(id: number) {
  return requestClient.get<PackageApi.Package>(`/wedding/package/get?id=${id}`);
}

/** 新增婚礼套餐 */
export function createPackage(data: PackageApi.Package) {
  return requestClient.post('/wedding/package/create', data);
}

/** 修改婚礼套餐 */
export function updatePackage(data: PackageApi.Package) {
  return requestClient.put('/wedding/package/update', data);
}

/** 删除婚礼套餐 */
export function deletePackage(id: number) {
  return requestClient.delete(`/wedding/package/delete?id=${id}`);
}


/** 导出婚礼套餐 */
export function exportPackage(params: any) {
  return requestClient.download('/wedding/package/export-excel', { params });
}

